#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "form.h"
#include "selectdevice.h"
#include "batteryset.h"
#include "serial_com.h"
#include "cali.h"
#include <QThread>
#include <QTimer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void closeEvent(QCloseEvent *event);

signals:
    void SendSet(QByteArray ba);
    void SendCom(QByteArray ba);
    void InitCom(QString portName);
    void MainClose();

public slots:
    void info_set_send(QByteArray ba);

private slots:
    void select_Open(int currentSelect);
    void openCali();
    void exitCali();
    void close_set();
    void comScan();

    void on_comboBox_currentIndexChanged(const QString &arg1);

    void on_pushButton_clicked();

private:
    Ui::MainWindow *ui;
    Form *newF;
    Form *new2;
    Form *new3;
    SelectDevice *s1;
    BatterySet *batSet;
    Cali *cali;


    QTimer *serialScan;
    Serial_com *com;
    QThread comT;
    QList<QSerialPortInfo> comList;
};

#endif // MAINWINDOW_H
